package com.bosicloud.cmb.ibp.aws.adapter.commom.constant;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * @author Jack Peng / ziliang.peng@bosicloud.com
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class AwsConstant {

    /**
     * StageVariables URL
     */
    public static final String STAGE_VARIABLES_URL = "url";

    /**
     * API Gateway Max Limit
     * @see com.amazonaws.services.apigateway.model.GetResourcesRequest#withLimit(java.lang.Integer)
     */
    public static final int API_GW_MAX_LIMIT = 500;

    /**
     * Endpoint占位符
     */
    public static final String ENDPOINT_HOLD_URL = "${stageVariables."+ STAGE_VARIABLES_URL +"}";

    /**
     * https://<restApiId>.execute-api.<awsRegion>.amazonaws.com/<stageName>
     * https://<restApiId>.execute-api.<awsRegion>.amazonaws.com.cn/<stageName>
     **/
    private static final String GW_INVOCK_URL = "https://%s.execute-api.%s.amazonaws.com.cn/%s";

    public static String getInvockUrl(String apiId, String region, String stageName) {
        return String.format(GW_INVOCK_URL, apiId, region, stageName);
    }
}
